新增一個Method,上方下拉選單選擇Server-side / C#,之後我們就可以開始撰寫程式囉
Aras系統中Part更變前的資料清單
Innovator inn = this.getInnovator();
Item Part = inn.newItem("Part", "get");
Part.setAttribute("select", "item_number,name");
Part.setAttribute("where", "[Part].item_number='Test'");
Part = Part.apply();
string test = Part.getProperty("name");
return inn.newError(test);
return this;
寫好code後在上方的Actions中點選Run Server Method,就能看到錯誤訊息中get出Part(Test)的name屬性欄位值(Aras1)
彈跳視窗顯示結果
Innovator inn = this.getInnovator();
Item Part = inn.newItem("Part", "add");
Part.setProperty("item_number","Test2");
Part.setProperty("name","PLM2");
Part = Part.apply();
return this;
Innovator inn = this.getInnovator();
Item Part = inn.newItem("Part", "edit");
Part.setAttribute("where", "[Part].item_number='Test2'");
Part.setProperty("name","PLM3");
Part = Part.apply();
return this;